#!/bin/sh

#   bridge-utils (for brctl, to manipulate bridges)
#   uml_utilities (for tunctl, to manipulate taps)
#   sudo (for manipulating bridges and tunnels as root)

if [ $# -lt 1 ] ; then
    DEV=eth0
else
    DEV=$1
fi

BRDEV=br0

sudo modprobe tun
sudo /usr/sbin/brctl  addbr $BRDEV
echo "Executing /etc/qemu-ifup"
echo "Bringing up $DEV for bridged mode..."
sudo /sbin/ifconfig $DEV 0.0.0.0 promisc up
echo "Adding $DEV to br0..."
sudo /usr/sbin/brctl addif $BRDEV $DEV
sleep 2

